class Solution
{
public:
    int numJewelsInStones(string jewels, string stones)
    {
        unordered_set j(jewels.begin(), jewels.end());
        int count = 0;
        for (char c : stones)
        {
            if (j.count(c))
            {
                ++count;
            }
        }
        return count;
    }
};